package com.hiedu.service.impl;

import com.hiedu.beans.vo.UserVO;
import com.hiedu.mapper.UserMapper;
import com.hiedu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ProjectName: hi-app
 * @Titile: UserServiceImpl
 * @Author: 86180
 * @Description: TODO
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public UserVO getUserInfo(Integer userId) {
// todo 对userId进行合法性校验
//判断用户编号是否存在
        UserVO userVO = userMapper.getById(userId);
        if(userVO == null){
            throw new RuntimeException("用户不存在");
        }
        return userVO;
    }
}